#pragma once


//#include "qwindow.h"
#include "qaerowindow.h"
#include "qgraphics.h"

#include "qstatusbar.h"
#include "qrebar.h"
#include "qtoolbar.h"
#include "qaccelerator.h"


namespace micro
{
namespace gui
{

class QMainFrame: public QWindow
{
protected:
    QString		m_strTitle;						//nu poate fi temporar daca se utilizeaza in WNDCLASSEX.......
    QWindow	*	m_pView;						// pointer to the View CWnd object


    //fullscreen
    bool	m_fullscreen;
    bool	m_metro_snap;
    bool	m_maximized;
    LONG	m_style;
    LONG	m_exStyle;
    HMENU	m_menu;
    QRect	m_wrect;

public:
    QMainFrame( );
    virtual		~QMainFrame( void );

    void	SetView( QWindow * );
    void	SetStatusText();
    void	SetStatusIndicators();
    void	SetPartWidth( int iPart, int iWidth );

protected:
    virtual bool	OnPreRegisterClass( WNDCLASS & w );
    virtual bool	OnSize( int type, int cx, int cy );
    virtual bool	OnCreateClient( void );
    virtual bool	OnSetFocus( HWND hwnd );

    virtual bool	OnEraseBackground( QGraphics * pdc );
    virtual bool    OnPaint( QGraphics * pdc );

    virtual bool	OnClose( void );
    virtual bool    OnDestroy();



    //virtual bool  OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
    virtual bool    OnCommand( WPARAM wParam, LPARAM lParam );
    virtual void	RecalcLayout();
    virtual bool	OnPreCreate( CREATESTRUCT & cs );
	virtual LPCTSTR GetWndClassName()
	{
		return _T( "QMFRAME" );
	}



public:
    QString GetTitle()
    {
        return m_strTitle;
    }
    void SetTitle( const QString & str )
    {
        m_strTitle = str;
    }

    bool IsFullScreen()
    {
        return m_fullscreen;
    }
	void FlipFullscreen()
	{
		SetFullscreenImpl(  !m_fullscreen , false );
	}
	void SetFullscreen( bool fullscreen )
	{
		if ( m_fullscreen == fullscreen )
			return;
		SetFullscreenImpl( fullscreen, false );
	}
	void SetMetroSnap( bool metro_snap )
	{
		if ( m_metro_snap == metro_snap )
			return;
		SetFullscreenImpl( metro_snap, true );
		m_metro_snap = metro_snap;
	}

	 

private:
    void SetFullscreenImpl( bool fullscreen, bool for_metro );
};




}//namespace

}//micro